<template>
    <transition name="fade">
        <div v-show="show" class="page-load" @mousedown.stop>
            <slot>
                <div class="multi-spinner-container">
                    <div class="multi-spinner">
                        <div class="multi-spinner">
                            <div class="multi-spinner">
                                <div class="multi-spinner">
                                    <div class="multi-spinner">
                                        <div class="multi-spinner"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </slot>
        </div>
    </transition>
</template>

<script lang="ts" setup>
defineProps({
    show: { type: Boolean, default: true },
});
</script>

<style lang="scss" scoped>
.page-load {
    position: fixed;
    z-index: 99;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(10px) brightness(100%);
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    .multi-spinner-container {
        position: relative;
        width: 100px;
        height: 100px;
        .multi-spinner {
            position: absolute;
            width: calc(100% - 9.9px);
            height: calc(100% - 9.9px);
            border: 5px solid transparent;
            border-top-color: #ffb922;
            border-radius: 50%;
            -webkit-animation: spin 5s cubic-bezier(0.17, 0.49, 0.96, 0.76) infinite;
            animation: spin 5s cubic-bezier(0.17, 0.49, 0.96, 0.76) infinite;
        }
    }
    @keyframes spin {
        from {
            -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
        }
        to {
            -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
        }
    }
}
</style>
